<script type="text/javascript">
    function Return()
    {
        alert("该老师暂无试题");
        return false;
    }
</script>
<div id="indexcates" >
        <?php
                global $db;
                $sql = "select * from nettteach_department where 1 = 1";
                $result_department = $db -> query($sql);
                while($row_department=$db->fetch_array($result_department)){

        ?><!--老师排行榜开始-->
        <div class="row-fluid" >
            <ul class="breadcrumb">
                <li><a href="#"><?php echo ($row_department['name'])?> </a> </li>
            </ul>
        </div>			
        <div id="01">
            <div class="row-fluid">
        <?php
                $sql = "select * from nettteach_member where type in('1','2') and departmentid = '".$row_department['id']."' ";
                $result = $db -> query($sql);
                $i=0;
                while($row=$db->fetch_array($result)){
                    $last_query  = "select * from ".DBPREFIX."exam where exam_pubuid=".$row['id']." and type=0 order by exam_pubtime desc limit 0,1";
                    $last_result  =$db->query($last_query);
                    $num = $db->num_rows($last_result);
        ?>
                <div class="span5">
                    
                    <h1><a href="?do=exerciselist&tid=<?php echo $row['id']?>"><?php echo($row['realname']);?> 老师</a></h1>
                    <p>该老师发布试题:<?php echo $num; ?>套</p>
                    <?php 
                          while($last_row=$db->fetch_array($last_result)){    
                        ?>
                        <p class="lastupdate">最后更新:<a href="?do=examinfo&id=<?php echo $last_row['exam_id']?>"><?php echo $last_row['exam_name']?></a></p>
                        <p>于：<?php echo date('Y-m-d H:i:s',$last_row['exam_pubtime']);?></p>
                        <p><a class="btn btn-info" href="?do=exerciselist&tid=<?php echo $row['id']?>" <?php if($_SESSION['sid']==''){ ?> onclick="return checkLogin()" <?php }?> >进入 »</a></p>
                        <?php 
                            
                        }
                        ?>
                </div><!--/span-->
                <?php }?>
            </div><!--/row-->
        </div>
        <?php }?>
</div>